<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="darkred">
    <van-swipe-item @click="toDetail(i)" v-for="i in bannerArr" :key="i.id">
      <img :src="i.image_url" alt />
    </van-swipe-item>
  </van-swipe>
</template>

<script>
export default {
  props: ['bannerArr'],
  methods: {
    toDetail (i) {
      this.$emit('toDetail', i.name.slice(2))
    }
  }
}
</script>

<style lang="less" scoped>
img {
  width: 100%;
  display: block;
}
</style>
